//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.comprosoft.telnet.command;

import com.comprosoft.telnet.configuration.ServerProperties;
import com.comprosoft.telnet.io.IOHandler;
import com.comprosoft.telnet.server.TelnetServer;

public final class PasswordCommandHandler extends Command {
    private String password;

    public PasswordCommandHandler(IOHandler io, TelnetServer telnetServer) {
        super(io, "password", telnetServer);
        this.password = ServerProperties.LOGIN_PASSWORD.getValue();
    }

    protected CommandResult handleCommand(String[] args) {
        StringBuffer commandStr = new StringBuffer();
        int i = 0;
        String[] var4 = args;
        int var5 = args.length;

        for(int var6 = 0; var6 < var5; ++var6) {
            String arg = var4[var6];
            if (i == 1) {
                commandStr.append(arg);
                break;
            }

            ++i;
        }

        return this.password.equals(commandStr.toString()) ? CommandResult.COMMAND_FILLED_PASSWORD : CommandResult.COMMAND_OK;
    }
}
